<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./index.css">
    <link rel="stylesheet" href="./reg.css">
    <link rel="stylesheet" href="./font_kcrxw23h6ie/iconfont.css">
    <link rel="stylesheet" href="./pdesc.css">
    <link rel="stylesheet" href="./font_oly21ackr6/iconfont.css">
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
</head>
<body>
    <div id="user">
        <ul>
            <li> <span class="iconfont icon-200yonghu_yonghu"></span> 账号</li>

            <li> <span class="iconfont icon-gouwudai_o"></span> <b>购物袋</b>
            <p>0</p>
            </li>
            <li> <span class="iconfont icon-wodeyouhuiquan"></span> </li>
            <li> <span class="iconfont icon-aixin"></span> </li>
            <li> <span class="iconfont icon-star"></span></li>
            <li> <span class="iconfont icon-lishijilu"></span></li>
            <li id="topT"> <span class="iconfont1 icon-shangyi"></span></li>
        </ul>
    </div>
    
        <nav>
            <div>
                <p>地址</p>
            <ul>
                <li id="users" style="display: non;"></li>
                
                <li id="login" ><a href="./login.html"> 登录</a></li>
                <span>/</span>
                <li id="esc">退出</li>
                <li id="reg"><a href="./register.html"> 注册</a></li>
                

                
                <span>/</span>
                <li>签到有礼</li>
                <span>/</span>
                <li>我的订单</li>
                <span>/</span>
                <li>我的特卖</li>
                <span>/</span>
                <li>会员俱乐部</li>
                <span>/</span>
                <li>客户服务</li>
                <span>/</span>
                <li>手机版</li>
                <span>/</span>
                <li>更多</li>
            </ul>
            </div>
        </nav>
        <div id="box">
            
            <div id="top-logo">
                <a href="index.html"><img src="./img/logo.png" alt="" id="logo"></a>
                <span>
                    <a href=""></a>
                     <a href=""></a>
                      <a href=""></a>
                </span>
                <div id="input">
                    <input type="text" name="" id="">
                    <button>搜索</button>
                    
                </div>
                
                <div id="cart">
                    <p> 购物车</p>
                    <span class="iconfont icon-gouwudai_o" ></span>
                    <div id="arrs">0</div>
                </div>
                
            </div>
    
            <div id="top-nav">
                <a href="index.html">
                <ul>
                    
                    <li>商品分类</li>
                    <li>推荐</li>
                    <li>3折疯抢</li>
                    <li>唯品快抢</li>
                    <li>唯品奥莱</li>
                    <li>女装</li>
                    <li>鞋包</li>
                    <li>运动</li>
                    <li>母婴</li>
                    <li>美妆</li>
                    <li>男装</li>
                    <li>电器</li>
                    <li>内衣</li>
                    <li>更多</li>
                    
                </ul>
                </a>
            </div>

            <div id="desc" style="height: 500px;"></div>
            <div id="nav">
                <div id="nav-box">
                    <ul>
                        <p style="margin-bottom: 5px;">正品保障</p>
                        <li>服务保障</li>
                        <li>七天无理由放心退</li>
                        <li>7*15小时客户服务</li>
                    </ul>
                    <ul>
                        <p style="margin-bottom: 5px;">购物指南</p>
                        <li>导购演示</li>
                        <li>订单操作</li>
                        <li>会员注册</li>
                        <li>账户管理</li>
                        <li>收货样品</li>
                    </ul>
                    <ul>
                        <p style="margin-bottom: 5px;">支付方式</p>
                        <li>23家主流网银支付</li>
                        <li>支付宝、银联等支付</li>
                        <li>信用卡支付</li>
                    </ul>
                    <ul>
                        <p style="margin-bottom: 5px;">配送方式</p>
                        <li>配送范围及运费</li>
                        <li>验货与签收</li>
                    </ul>
                    <ul>
                        <p style="margin-bottom: 5px;">售后服务</p>
                        <li>退货政策</li>
                        <li>退货流程</li>
                        <li>退款方式和时效</li>
                        <li>换货服务</li>
                    </ul>
                    <ul>
                      
                    </ul>

                </div>
                <ul id="list">
                    <li>关于我们&nbsp;</li>
                    <li>About us&nbsp; </li>
                    <li>Investor Relations&nbsp; </li>
                    <li>媒体报道&nbsp; </li>
                    <li>品牌招商&nbsp; </li>
                    <li>平台规则&nbsp; </li>
                    <li>隐私条款&nbsp; </li>
                    <li>唯品诚聘 &nbsp;</li>
                    <li>唯品卡&nbsp; </li>
                    <li>联系我们&nbsp; </li>
                    <li>廉正举报 &nbsp;</li>

                </ul>
            </div>

            <div id="box-bottom">
                <p>Copyright © 2008-现在 vip.com，All Rights Reserved  使用本网站即表示接受 唯品会用户协议。版权所有 广州唯品会电子商务有限公司</p>
                <p>粤公网安备 44010302111111号    粤ICP备08114786号 增值业务经营许可证：粤B2-20170777 网络文化经营许可证：粤网文〔2021〕2056-282号</p>
                <p>经营主体证照   风险监测信息   互联网药品信息服务资格证书：（粤）-经营性-2018-0271 网络食品交易第三方平台备案凭证：粤B2-20170777 医疗器械网络交易服务第三方平台备案凭证：（粤）网械平台备字[2019]第00001号 出版物网络交易平台服务经营备案证：粤新出网备（2021）1号  未成年人关怀专区</p>
                <p>违法和不良信息举报电话：4006789888；举报邮箱：privacy@vipshop.com</p>
            </div>
            <!-- <a href='detail.html?pid=${v.pid}'></a> -->
        </div>


        <script>
            let desc = document.querySelector("#desc")
            let obj = new URLSearchParams(location.search)
            let pid = obj.get('pid')
            let uid = localStorage.getItem('uid')
            console.log(pid);

            let url = "http://jx.xuzhixiang.top/ap/api/detail.php"
                axios.get(url,{params:{id:pid}}).then((r)=>{
             console.log(r.data);
             let pobj = r.data.data;
             console.log(pobj);
             console.log(pobj.pname);
             console.log(pobj.pimg);
             let str = `
             
                <div>
                <img src="${pobj.pimg}" alt="">
                <p>商品编码：${pobj.pid}</p>
                </div>
                <div>
                <h2>${pobj.pname}</h2>
                <h1>￥${pobj.pprice}</h1>
                <p>￥<span>298</span> ${pobj.pdesc}</p>
                <h3><span>运费&nbsp;&nbsp;</span>新会员专享首单满38元免邮（限唯品国际商品，部分商品不可用）</h3>
                <h3><span>规格&nbsp;&nbsp;</span>毫升</h3>
                <h3><span>数量&nbsp;&nbsp;</span><input min='1' type="number" value='1'id="pnum"></h3>
                
                
                <button id="btn" onclick="cartClick()"><span>￥298</span><span>${pobj.pprice}</span></</button>
            </div>
             `
             desc.innerHTML = str
            console.log(pobj.pid);
         })



         let username = localStorage.getItem("username")
        console.log(username);

        let topT = document.querySelector("#topT")
    topT.onclick = function(e){
    console.log(e.screenX);
        document.documentElement.scrollTo({top:0,behavior:"smooth"})

}
        



let users = document.querySelector("#users")
console.log(users);
users.innerHTML = username 
let login = document.querySelector("#login")
let reg = document.querySelector("#reg")
let esc = document.querySelector("#esc")
login.style.display="none"
reg.style.display= "none"
if(username == null){
    login.style.display="block"
    reg.style.display= "block"
    esc.style.display = "none"
    console.log(11111);
}
esc.onclick = function(){
    localStorage.clear()
    location.reload()
    console.log(username);
}
console.log(username);
        </script>
</body>
</html>